﻿@inject ISnackbar SnackbarService

<MudButton OnClick="@ShowDefault">Show default snackbar</MudButton>

@code {
    public static string __description__ = "Show snackbar that has custom content message class applied";

    private const string MessageText = "Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch is a village in Anglesey, Wales, United Kingdom.";
    private const string ActionText = "Learn Pronunciation";

    protected override void OnInitialized()
    {
        SnackbarService.Configuration.PositionClass = Defaults.Classes.Position.BottomRight;
        SnackbarService.Configuration.PreventDuplicates = false;
        SnackbarService.Configuration.ShowCloseIcon = true;
        SnackbarService.Configuration.RequireInteraction = true;

        base.OnInitialized();
    }

    private void ShowDefault()
    {
        SnackbarService.Add(MessageText, Severity.Info, options =>
        {
            options.Action = ActionText;
        });
    }
}